<?php

/**
 * Cerere form.
 *
 * @package    vvberp
 * @subpackage form
 * @author     Flo
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class CerereForm extends BaseCerereForm
{
  public function configure()
  {
    $this->setWidgets(array(
      'id'                   => new sfWidgetFormInputHidden(),
      'client_id'            => new sfWidgetFormPropelChoice(array('model' => 'Client', 'add_empty' => false)),
      'data_limita'          => new sfWidgetFormDate(),
      'pret_tinta'           => new sfWidgetFormInput(),
      'note'                 => new sfWidgetFormTextarea(),
      'cerere_furnizor_list' => new sfWidgetFormPropelChoiceMany(array('model' => 'Furnizor')),
      'cerere_produs_list'   => new sfWidgetFormPropelChoiceMany(array('model' => 'Produs')),
    ));
    
    $this->widgetSchema->setNameFormat('cerere[%s]');
    
    $this->setValidators(array(
      'id'                   => new sfValidatorPropelChoice(array('model' => 'Cerere', 'column' => 'id', 'required' => false)),
      'client_id'            => new sfValidatorPropelChoice(array('model' => 'Client', 'column' => 'id')),
      'data_limita'          => new sfValidatorDate(array('required' => false)),
      'pret_tinta'           => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'note'                 => new sfValidatorString(array('required' => false)),
      'cerere_furnizor_list' => new sfValidatorPropelChoiceMany(array('model' => 'Furnizor', 'required' => false)),
      'cerere_produs_list'   => new sfValidatorPropelChoiceMany(array('model' => 'Produs', 'required' => false)),
    ));
  }
}
